import com.alibaba.fastjson.JSON;
import com.clms.system.pojo.entitry.SysOperLog;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.*;

/**
 * @program: clms-third
 * @description:
 * @author: 大鱼
 * @create: 2021-07-22 19:59
 **/
public class Test {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {

        Class operLog = SysOperLog.class;
        Field[] fields = operLog.getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true);
            System.out.println(field.getName());

        }
        SysOperLog sysOperLog = new SysOperLog();
//        sysOperLog.setDeptName("???");
//        sysOperLogs.setOperId(2);
//        Method[] method = operLog.getMethods();
//        Object o = operLog.newInstance();
//        for (Method method1 : method) {
//            if (method1.getName().contains("get")) {
//                String k = method1.getName();
//                operLog.getDeclaredMethod(k);
//
//                System.out.println( operLog.getDeclaredMethod(method1.getName())+k);
//            }
//
//        }


       TreeMap map = JSON.parseObject(JSON.toJSONString(sysOperLog), TreeMap.class);
        for (Field field : fields) {
            field.setAccessible(true);
            System.out.println(field.getName());
            System.out.println(map.get(field.getName()));

        }
    }
}
